home *** CD-ROM | disk | FTP | other *** search
- /*
- DarkSide 3.0 - a 7.0 dependant, system clean expandable screen saver.
-
- copyright ⌐╩1990, 1991, 1992 by Tom Dowdy
- All rights reserved.
-
- This header file defines the interface between DarkSide and one of
- its faders.
-
- */
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __OSUTILS__
- #include <OSUtils.h>
- #endif
- #ifndef __QUICKDRAW__
- #include <QuickDraw.h>
- #endif
-
- #define preflightFader 0
- #define initializeFader 1
- #define idleFader 2
- #define disposeFader 3
- #define updateFader 4
- #define hitFader 5
-
- // info about a screen
- typedef struct
- {
- Rect bounds; // bounds of that screen within our window
- Boolean isColor; // color or bw/gray
- short depth; // depth in pixels
- GDHandle theDevice; // device that goes with that screen
- } ScreenInfo, *ScreenInfoPtr;
-
- // storage for the user's settings
- #define numShorts 20
- #define numStrings 4
- typedef struct
- {
- short theShorts[numShorts];
- Str255 theStrings[numStrings];
- } SettingsBlock, *SettingsPtr;
-
- // currently supported options
- #define keyAndMouseUnfade 0x0001 // 0 if fader is allowing keystrokes/mouse motion
- #define faderRequestsUnfade 0x0002 // 1 if fader wishes to cause an unfade
- #define faderRequestsNoWindow 0x0004 // 1 if fader wishes no fade window
-
- // info about the machine
- typedef struct
- {
- SysEnvRec theEnvirons; // info about the machine
- WindowPtr fadeWindow; // where the fade is taking place
- Ptr applicationQD; // app QuickDraw globals
- long applicationA5; // A5 for the application
- long faderOptions; // options for the fader to give to DarkSide
- SettingsPtr faderSettings; // user's settings for the fader
- DialogPtr settingsDialog; // dialog with the settings
-
- short numScreens; // how many screens there are
- ScreenInfo theScreens[20]; // info about each screen
- } MachineInfoRec, *MachineInfoPtr;
-
-
-
- OSErr PreflightFader(MachineInfoPtr machineInfo, long *minTicks, long *maxTicks);
- OSErr InitializeFader(MachineInfoPtr machineInfo);
- OSErr IdleFader(MachineInfoPtr machineInfo);
- OSErr DisposeFader(MachineInfoPtr machineInfo);
- OSErr UpdateFader(MachineInfoPtr machineInfo);
- OSErr HitFader(MachineInfoPtr machineInfo, DialogPtr dPtr, short itemHit, short itemOffset);
-
-
- // Utilities
- Handle BestNewHandle(Size theSize);
- RgnHandle BestNewRgn();
- short Rnd(long max);
- void PlaceRectOnScreen(
- MachineInfoPtr machineInfo, // give info about the machine here
- short width, // width of rect, can be 0
- short height, // height of rect, can be 0
- Rect * placedRect, // Placed rect is returned here
- Rect * margins, // margins around screen, can be nil
- short * whichScreen); // screen index returned here, can be nil
-
-
- /* ------------------------------------------------------------------------------------ */
- /* Useful macros for your fader */
- /* ------------------------------------------------------------------------------------ */
- #define TopLeft(aRect) (* (Point *) &(aRect).top)
- #define BotRight(aRect) (* (Point *) &(aRect).bottom)
- #define RectWidth(r) (short)((r)->right - (r)->left)
- #define RectHeight(r) (short)((r)->bottom - (r)->top)
-